//
//  TableScrollView.m
//  GrandCentralCarT3
//
//  Created by Xue Senhong on 15/5/21.
//  Copyright (c) 2015年 薛森鸿. All rights reserved.
//

#import "TableScrollView.h"

@implementation TableScrollView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        
        self.array = [NSMutableArray array];
        self.myScrollView = [[UIScrollView alloc] init];
        [self addSubview:self.myScrollView];
        // 滚动范围
        self.myScrollView.contentSize = CGSizeMake(1 * 320, 0);
        // 整屏滚动
        self.myScrollView.pagingEnabled = YES;
        // 关闭弹动效果
        self.myScrollView.bounces = NO;
//        // tableView
//        for (int i = 0; i < self.array.count; i ++) {
//            self.myTableView = [self.array objectAtIndex:i];
//            self.myTableView.frame = CGRectMake(0 * (i + 320), 64, 320, 568);
//            [self.myScrollView addSubview:self.myTableView];
//        }

        [_myScrollView release];
//        [_myTableView release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.myScrollView setFrame:self.bounds];
}

- (void)dealloc
{
    [_myTableView release];
    [_myScrollView release];
    [super dealloc];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
